﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ASPItalia.ModelVirtualCasting.Common;
using ASPItalia.ModelVirtualCasting.ObjectModel;

namespace ASPItalia.ModelVirtualCasting.EntityFramework.Test
{
	class Program
	{
		static void Main(string[] args)
		{
			ICandidateRepository repository = ApplicationContext.Current.Candidates;
			WriteCandidate(repository.GetAll());
			WriteCandidate(repository.Include("JobLevel").GetAll());
			WriteCandidate(repository.EnableLazyLoading().GetAll());
		}

		static void WriteCandidate(IQueryable<Candidate> candidates)
		{
			foreach (Candidate c in candidates)
			{
				Console.WriteLine("{0}-{1}", c.FirstName + c.LastName, (c.JobLevel == null) ? String.Empty : c.JobLevel.JobLevelName);
			}
			Console.ReadLine();
		}
	}
}